package com.md.model.request.system.api;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.md.model.ModuleEnum;
import com.md.model.system.Pages;
import com.md.util.StringUtil;
import com.md.value.enums.AuthEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author 刘骄阳
 * 2022-09-24 1:24
 */

@Data
@ApiModel("查询接口请求实体")
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class QueryApiRequest extends Pages {
  @ApiModelProperty("主键id")
  @JsonFormat(shape = JsonFormat.Shape.STRING)
  private Long id;
  /**
   * 接口路径
   */
  @ApiModelProperty("接口路径")
  private String url;
  /**
   * 接口名
   */
  @ApiModelProperty("接口名")
  private String name;
  /**
   * 权限(0:无需权限;1:需要权限;2:禁止访问)
   */
  @ApiModelProperty("权限(0:无需权限;1:需要权限;2:禁止访问)")
  private AuthEnum auth;
  /**
   * 所属模块
   */
  @ApiModelProperty("所属模块")
  private ModuleEnum module;

  @Override
  public String toString() {
    return StringUtil.objectToJson(this);
  }

}
